import ProjectGrid from './ProjectGrid';
import React from 'react';
import {ScrollView, Text, View} from 'react-native';

// const data = Array.from(new Array(9)).map((_val, i) => ({
//   icon: 'https://os.alipayobjects.com/rmsportal/IptWdCkrtkAUfjE.png',
//   text: `Name${i}`,
// }));

function getData(count) {
  return Array.from(new Array(count)).map((_val, i) => ({
    icon: 'https://os.alipayobjects.com/rmsportal/IptWdCkrtkAUfjE.png',
    text: `Name${i}`,
  }))
}

export default class ProjectGridDemo extends React.Component {
  render() {
    return (
      <ScrollView>
        <View style={[{margin: 10}]}>
          <Text>Simple</Text>
        </View>
        <View style={[{padding: 10}]}>
          <ProjectGrid data={getData(1)} hasLine={true}/>
        </View>

        <View style={[{margin: 10}]}>
          <Text>two</Text>
        </View>
        <View style={[{padding: 10}]}>
          <ProjectGrid data={getData(2)} hasLine={false}/>
        </View>

        <View style={[{margin: 10}]}>
          <Text>four</Text>
        </View>
        <View style={[{padding: 10}]}>
          <ProjectGrid data={getData(4)} hasLine={true}/>
        </View>
      </ScrollView>
    );
  }
}
